﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XLang;

namespace ALang.AST
{
    public class Identifier : Token
    {
        public static string Token(LContext context)
        {
            if (!char.IsLetter(context.CurrentChar)) return null;

            var sb = new StringBuilder();
            while (char.IsLetterOrDigit(context.CurrentChar)) {
                sb.Append(context.CurrentChar);
                context.GetChar();
            }
            return sb.ToString();
        }
    }
}
